﻿@using PagedList.Mvc;
@{
    PagedList.IPagedList<Model.Origins.ApplyCodeModel> myPageList = (PagedList.IPagedList<Model.Origins.ApplyCodeModel>)ViewBag.MyPageList;
    Layout = "~/Views/Shared/MyLayOutNew.cshtml";
}
<!DOCTYPE html>

<link href="~/Content/PagedList.css" rel="stylesheet" />
<main class="main-cont content mCustomScrollbar">
    <div class="page-wrap">
        <!--开始::内容-->
        <section class="page-hd">
            <header>
                <h2 class="title">溯源管理>>审核码</h2>
                <p class="title-description">
                 
                    <button class="btn btn-primary" onclick="Apply();">审核</button>
              
                </p>
            </header>
            <hr>
        </section>
        <table class="table mb-15">
            <thead>
                <tr>
                    <th><input type="checkbox" /></th>
                    <th>机构名称</th>
                    <th>机构编码</th>
                    <th>申请数量</th>
                    <th>申请人</th>
                    <th>申请时间</th>
                    <th>申请状态</th>
                    <th>备注</th>
                    @*<th>操作</th>*@
                </tr>
            </thead>
            <tbody>

                @foreach (var item in myPageList)
                {
                    <tr class="cen">
                        <td><input type="checkbox" value="@item.ID" class="checkbox" /></td>
                        <td>
                            @Html.DisplayFor(modelItem => item.EnterpriseName)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.Code)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.ApplyNum)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.CreateLoginName)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.CreateDate)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.StatusRemark)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.Remark)
                        </td>
                        @*<td>
                            <a title="申请" class="mr-5" onclick="Edit(@item.ID)">编辑</a>
                        </td>*@
                    </tr>
                }

            </tbody>
        </table>
        每页 @myPageList.PageSize 条记录，共 @myPageList.PageCount 页，当前第 @myPageList.PageNumber 页
        @Html.PagedListPager(myPageList, page => Url.Action("Index", new { page }))
        <!--开始::结束-->
    </div>
</main>
<script type="text/javascript">
 
    function Apply() {
      
        //获取选中的ID
       var id = $(".checkbox:checked").val();
       var len = $(".checkbox:checked").length;
        if (id == null ||len>1) {
            alert("请选中一条记录");
            return;
        }
        
            window.location.href = "/ApplyCode/Apply?id=" + id ;
    }
  
</script>